<?php

class Exam_Widget_SlideshowExamController extends Engine_Content_Widget_Abstract {

  public function indexAction() {

    // List exam featured
    $table = Engine_Api::_()->getDbtable('exams','exam');
    $select = $table->select()
                ->where('feature = 1')
                ->order('RAND() DESC');
                
    $this->view->listexam = $exam = $table->fetchAll($select);
    $this->view->exam_feature = $exam->exam_feature;
    // Count Featured Classiifed
    $this->view->examcount = $exam->count();

//    $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;
//    $values = '';

    // Get the featured content id which are "Mix Type of Slide Show".
    // Here we are making object for "Slide Show".
    $this->view->show_slideshow_object = $exam;

    // Start Settings
    // Number of the result.
    $this->view->num_of_slideshow = count($exam);
    if (!(count($exam) > 0)) {
      return $this->setNoRender();
    } 

    $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');
  }
}